

<div class="form">

<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'bpapplication-form',
	'enableAjaxValidation'=>true,
)); ?>

	<p class="note"><?php  echo Yii::t('application', 'Fields with <span class="required">*</span> are required.');?></p>

	<?php echo $form->errorSummary($model); ?>

	<div class="row">
		<?php echo $form->labelEx($model,'idbpapplication'); ?>		
                <?php echo $form->textField($model,'idbpapplication',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'idbpapplication'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'applicantname'); ?>		
                <?php echo $form->textField($model,'applicantname',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'applicantname'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'applicantaddress'); ?>		
                <?php echo $form->textField($model,'applicantaddress',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'applicantaddress'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'plotstatus'); ?>		
                <?php echo $form->textField($model,'plotstatus',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'plotstatus'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'idbpuseagetype'); ?>		
                <?php echo $form->textField($model,'idbpuseagetype',array('size'=>10,'maxlength'=>10,'ajax'=>array('type'=>'POST', 'dataType'=>'json', 'data'=>array('cid'=>'js:$(\'#Bpapplication_idbpuseagetype\').val()',), 'url'=>CController::createUrl('bpuseagetype/jsonmessage'), 'success'=>'function(data){$(\'#' . CHtml::activeId($model,'idbpuseagetype') . '_msg\').text(data.message);}'))); ?>
                <span id="<?php echo CHtml::activeId($model,'idbpuseagetype'); ?>_msg">
                    <?php echo !isset($model->idbpuseagetype0->usagetype) || $model->isNewRecord ? "-" : $model->idbpuseagetype0->usagetype; ?>
                </span>
                <?php
                    $imghtml = CHtml::image(Yii::app()->request->baseUrl . '/images/tooltip.png');
                    echo CHtml::link($imghtml, "", array(
                        'style' => 'cursor: pointer; text-decoration: underline;',
                        'onclick' => "{popupview('idbpuseagetype', 'index.php?r=bpuseagetype/popupview'); }"));
                    ?>
		<?php echo $form->error($model,'idbpuseagetype'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'newusagetype'); ?>		
                <?php echo $form->textField($model,'newusagetype',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'newusagetype'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'newconstructionarea'); ?>		
                <?php echo $form->textField($model,'newconstructionarea',array('size'=>15,'maxlength'=>15)); ?>
		<?php echo $form->error($model,'newconstructionarea'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'groundfloorarea'); ?>		
                <?php echo $form->textField($model,'groundfloorarea',array('size'=>15,'maxlength'=>15)); ?>
		<?php echo $form->error($model,'groundfloorarea'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'firstfloorarea'); ?>		
                <?php echo $form->textField($model,'firstfloorarea',array('size'=>15,'maxlength'=>15)); ?>
		<?php echo $form->error($model,'firstfloorarea'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'secondfloorarea'); ?>		
                <?php echo $form->textField($model,'secondfloorarea',array('size'=>15,'maxlength'=>15)); ?>
		<?php echo $form->error($model,'secondfloorarea'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'abovethirdbasement'); ?>		
                <?php echo $form->textField($model,'abovethirdbasement',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'abovethirdbasement'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'earthqcertificate'); ?>		
                <?php echo $form->textField($model,'earthqcertificate'); ?>
		<?php echo $form->error($model,'earthqcertificate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'registrycopy'); ?>		
                <?php echo $form->textField($model,'registrycopy'); ?>
		<?php echo $form->error($model,'registrycopy'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'kharasmap'); ?>		
                <?php echo $form->textField($model,'kharasmap'); ?>
		<?php echo $form->error($model,'kharasmap'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'blueprint'); ?>		
                <?php echo $form->textField($model,'blueprint'); ?>
		<?php echo $form->error($model,'blueprint'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'permissiondate'); ?>		
                <?php echo $form->textField($model,'permissiondate'); ?>
		<?php echo $form->error($model,'permissiondate'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'caseno'); ?>		
                <?php echo $form->textField($model,'caseno',array('size'=>10,'maxlength'=>10)); ?>
		<?php echo $form->error($model,'caseno'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'otherdetails'); ?>		
                <?php echo $form->textField($model,'otherdetails',array('size'=>60,'maxlength'=>100)); ?>
		<?php echo $form->error($model,'otherdetails'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'idccfyear'); ?>		
                <?php echo $form->textField($model,'idccfyear',array('size'=>10,'maxlength'=>10,'ajax'=>array('type'=>'POST', 'dataType'=>'json', 'data'=>array('cid'=>'js:$(\'#Bpapplication_idccfyear\').val()',), 'url'=>CController::createUrl('ccfyear/jsonmessage'), 'success'=>'function(data){$(\'#' . CHtml::activeId($model,'idccfyear') . '_msg\').text(data.message);}'))); ?>
                <span id="<?php echo CHtml::activeId($model,'idccfyear'); ?>_msg">
                    <?php echo !isset($model->idccfyear0->fyear) || $model->isNewRecord ? "-" : $model->idccfyear0->fyear; ?>
                </span>
                <?php
                    $imghtml = CHtml::image(Yii::app()->request->baseUrl . '/images/tooltip.png');
                    echo CHtml::link($imghtml, "", array(
                        'style' => 'cursor: pointer; text-decoration: underline;',
                        'onclick' => "{popupview('idccfyear', 'index.php?r=ccfyear/popupview'); }"));
                    ?>
		<?php echo $form->error($model,'idccfyear'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($model,'idccstatus'); ?>		
                <?php echo $form->textField($model,'idccstatus',array('size'=>10,'maxlength'=>10,'ajax'=>array('type'=>'POST', 'dataType'=>'json', 'data'=>array('cid'=>'js:$(\'#Bpapplication_idccstatus\').val()',), 'url'=>CController::createUrl('ccstatus/jsonmessage'), 'success'=>'function(data){$(\'#' . CHtml::activeId($model,'idccstatus') . '_msg\').text(data.message);}'))); ?>
                <span id="<?php echo CHtml::activeId($model,'idccstatus'); ?>_msg">
                    <?php echo !isset($model->idccstatus0->statusname) || $model->isNewRecord ? "-" : $model->idccstatus0->statusname; ?>
                </span>
                <?php
                    $imghtml = CHtml::image(Yii::app()->request->baseUrl . '/images/tooltip.png');
                    echo CHtml::link($imghtml, "", array(
                        'style' => 'cursor: pointer; text-decoration: underline;',
                        'onclick' => "{popupview('idccstatus', 'index.php?r=ccstatus/popupview'); }"));
                    ?>
		<?php echo $form->error($model,'idccstatus'); ?>
	</div>

	<div class="row buttons">
		<?php echo CHtml::submitButton($model->isNewRecord ? Yii::t('application', 'Create') : Yii::t('application', 'Save')); ?>
	</div>

<?php $this->endWidget(); ?>

</div><!-- form -->

<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(// the dialog
    'id' => 'dialog' . get_class($model) . '_idbpuseagetype',
    'options' => array(
        'title' => Yii::t('application', 'Bpuseagetypes'),
        'autoOpen' => false,
        'modal' => true,
        'width' => 550,
        'height' => 470,
    ),
));
?>
<div class="divforidbpuseagetype"></div>
<?php $this->endWidget(); ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(// the dialog
    'id' => 'dialog' . get_class($model) . '_idccfyear',
    'options' => array(
        'title' => Yii::t('application', 'Ccfyears'),
        'autoOpen' => false,
        'modal' => true,
        'width' => 550,
        'height' => 470,
    ),
));
?>
<div class="divforidccfyear"></div>
<?php $this->endWidget(); ?>
<?php
$this->beginWidget('zii.widgets.jui.CJuiDialog', array(// the dialog
    'id' => 'dialog' . get_class($model) . '_idccstatus',
    'options' => array(
        'title' => Yii::t('application', 'Ccstatuses'),
        'autoOpen' => false,
        'modal' => true,
        'width' => 550,
        'height' => 470,
    ),
));
?>
<div class="divforidccstatus"></div>
<?php $this->endWidget(); ?>

<script type="text/javascript">
    function popupview(id, url)
    {
        jQuery.ajax({'url':url,'data':'isAjaxRequest=1&id=<?php echo get_class($model);?>_' + id,'type':'post','dataType':'json','success':function(data)
            {
                $('#dialog<?php echo get_class($model);?>_' + id +' div.divfor' + id).html(data.div);
            } ,'cache':false});
        $('#dialog<?php echo get_class($model);?>_' + id).dialog('open');
        return false;
    }
</script>
